<template>
  <section class="app-container">
    <section class="app-head">
      <div class="app-head-left"></div>
      <div class="app-head-center">
        <span class="app-head-title">中压车间动环监测看板</span>
      </div>
      <div class="app-head-right">
        <span>{{ currentTime }}</span>
      </div>
    </section>
    <section class="app-main">
      <RouterView />
    </section>
  </section>
</template>
<script setup>
  import dayjs from 'dayjs';

  // 时钟
  const currentTime = ref('');
  let timer;
  onMounted(() => {
    // 时钟
    timer = setInterval(() => {
      currentTime.value = dayjs().format('YYYY-MM-DD HH:mm:ss');
    }, 1000);
  });

  onUnmounted(() => {
    timer && clearInterval(timer);
  });
</script>
<style lang="scss">
  @use './index.scss';
</style>
